<?php
/**
 * 描述：供应链-主页。
 * @final
 */
final class Exec_Chain_Index extends Exec
{
    public function Get()
    {
        #获取数据-行业数据
        View::Assign('Chain_Index_Trade',DAO_Trade::GetData());

        #获取数据-经营模式       
        View::Assign('Chain_Index_BusinessModel',DAO_BusinessModel::GetData());

        #获取数据-资讯排行        
        View::Assign('Chain_Index_News_Ranking',DAO_News::Ranking());

        #获取数据-DM杂志
        $data=DB::GetRows('select * from DM order by ID desc limit 0,1');
        if($data)
        {
            $data=$data[0];
            $data['CoverLocation']=Config::PATH_RELATIVE_ATTACHMENT_TEMP.'/'.$data['CoverLocation'];
        }
        View::Assign('Chain_Index_DM',$data);

        #获取数据-电子期刊
        $data=DB::GetRows('select * from ejournal order by ID desc limit 0,5');
        View::Assign('Chain_Index_Ejournal',$data);

        #获取数据-专题
        $data=DB::GetRows('select * from topic order by ID desc limit 0,3');
        foreach($data as &$row)
        {
            $row['ThumbnailPath']=Config::PATH_RELATIVE_ATTACHMENT_TOPIC.'/'.$row['ThumbnailPath'];
        }
        View::Assign('Chain_Index_Topic_Topside',@$data[0]);
        View::Assign('Chain_Index_Topic',array_slice($data,1,count($data)));
        
        #渲染输出
        View::Display('chain/index.tpl');
    }
}
?>